package org.flashamaphone.voices
{
	import org.flashamaphone.voices.waveformFactories.IWaveFactory;
	import org.flashamaphone.voices.waveformFactories.SineWaveFactory;
	import org.flashamaphone.voices.envelope.Envelope;

	public class VoiceConfig
	{
		/** press envelope */
		public var pressEnvelope:Envelope;
		
		/** hold envelope */
		public var holdEnvelope:Envelope;
		
		/** unpress envelope */
		public var unpressEnvelope:Envelope;
	
		
		/** press wave generator */
		public var pressWave:IWaveFactory;
		
		/** hold wave generator */
		public var holdWave:IWaveFactory;
		
		/** unpress wave generator */
		public var unpressWave:IWaveFactory;
		
		
		/** press duration (milliseconds) */
		public var pressDuration:int = 100;
		
		/** unpress duration (milliseconds) */
		public var unpressDuration:int = 100;
		
		/** hold duration (milliseconds), -1 implies infinite */
		public var holdDuration:int = -1;
		
		/**
		 * constructor
		 * 
		 * @param wave factory
		 */
		public function VoiceConfig(wavefactory:IWaveFactory = null):void {
			if (!wavefactory) {
				pressWave = new SineWaveFactory();
				holdWave = new SineWaveFactory();
				unpressWave = new SineWaveFactory();
			} else {
				pressWave = wavefactory;
				holdWave = wavefactory;
				unpressWave = wavefactory;
			}
		}
	}
}